<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>信息管理</title>
	<meta name="decorator" content="default"/>
<!-- <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=RX9lLA27RzGIuPHpsjYToPVvy0tw8lQg"></script>
<script type="text/javascript" src="http://api.map.baidu.com/library/TextIconOverlay/1.2/src/TextIconOverlay_min.js"></script>
<script type="text/javascript" src="http://api.map.baidu.com/library/MarkerClusterer/1.2/src/MarkerClusterer_min.js"></script>
<script type="text/javascript" src="http://api.map.baidu.com/library/DistanceTool/1.2/src/DistanceTool_min.js"></script>   -->

	<script type="text/javascript">
		$(document).ready(function() {
			$("#btnImport").click(function(){
				$.jBox($("#importBox").html(), {title:"导入信息登记", buttons:{"关闭":true}, 
					bottomText:"导入文件不能超过5M，仅允许导入“doc文件”！"});
			});
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
		
		function yanqi(id){
			$("#id").val(id);
			$('#demoModal').modal('show');
		}
		
		function shangchuan(){
			var id=$("#id").val();
			var time=$("#time").val();
			var yuan=$("#yuan").val();
			if(time!=null&&time!=''){
				if(!isNaN(time)){
					$("#formdatayan").submit();
				
				}else{
					alert("只可以输入数字");
				}
			}else{
				alert("延期天数不可为空");
			}
		}
	/* 	$(function(){
			$("#left", parent.document).hide();
			var content_iframe = window.parent.document.getElementById("right");
			content_iframe.style.width= "100%";
				}) */
	</script>
	
	
	<style type="text/css">
	.input-medium1{
	width: 80px
	}
	#left{
	display: none;
	}
	</style>
</head>
<body>

	<ul class="nav nav-tabs">
		<shiro:hasPermission name="numberinfo:yhcgNumberinfo:edit"><li><a href="${ctx}/numberinfo/yhcgNumberinfo/form">信息登记</a></li></shiro:hasPermission>
		<li class="active"><a href="${ctx}/numberinfo/yhcgNumberinfo/">查看已登记</a></li>
	</ul>
	<!-- <table style="width: 100%;height: 100%" class="table table-striped table-bordered table-condensed">
	<tr>
	<td style="width: 30%;height: 500px">
	<div style="width:99%;height:99%;float: left; " id="allmap" >
	</div>
	</td>
	<td style="width: 70%;height: 70%">
	<div style="width: 900px;height:99%;float: right" > -->
	<form:form id="searchForm" modelAttribute="yhcgNumberinfo" action="${ctx}/numberinfo/yhcgNumberinfo/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<ul class="ul-form">
			<li><label>编号：</label>
				<form:input path="number" htmlEscape="false" maxlength="255" class="input-medium1"/>
			</li>
			<li><label>来源：</label>
				<form:select path="come" class="input-medium required"   type="select[disabled]">
					<form:option value="">请选择</form:option>
					<form:options items="${fns:getDictList('come_type')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
			</li>
			<li>
			<label>事件类别</label>
			<form:select path="type" class="input-medium required">
					<form:option value="">请选择</form:option>
					<form:options items="${fns:getDictList('type_type')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
			</li> 
			<li>
			<label>责任单位</label>
			<form:select  path="responsibilityunit" class="input-medium" >
				
					<form:options items="${list}" itemLabel="name" itemValue="id" htmlEscape="false"/>
					<form:option value="">请选择</form:option>
				</form:select>
			</li>
		 	<li>
			<label>督办单位</label>
			<form:select  path="supervisionunit" class="input-medium" >
				
					<form:options items="${list1}" itemLabel="name" itemValue="id" htmlEscape="false"/>
					<form:option value="">请选择</form:option>
				</form:select>
		 	</li> 
			 <li><label>关键字：</label>
				<form:input path="content" htmlEscape="false" class="input-medium"/>
			</li> 
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
							<input id="btnImport" class="btn btn-primary" type="button" value="导入"/>
			</li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				
				<th>登记编号</th>
				<th>来源</th>
				<th>事件类别</th>
				<th>转办时间</th> 
				<th>还剩天数</th>
				<th>主要内容</th>
				<th>责任单位</th>
				<th>督办单位</th>
				<th>处理结果</th>
				<th>查看</th>
				<!-- <th>删除</th> -->
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="yhcgNumberinfo">
			<tr>
				<td>
					${yhcgNumberinfo.number}
				</td>
				<td>
					${fns:getDictLabel(yhcgNumberinfo.come, 'come_type', '')}
				</td>
				<td>
					${fns:getDictLabel(yhcgNumberinfo.type, 'type_type', '')}
				</td>
				<td>
				<fmt:formatDate value="${yhcgNumberinfo.createtime}" pattern="yyyy-MM-dd HH:mm:ss"/>
				</td> 
				<td>
				${fns:DateList(yhcgNumberinfo.timelimit, '')}
				</td>
				<td>
				<span title="${yhcgNumberinfo.content}" >${fn:substring(yhcgNumberinfo.content, 0, 10)}</span>	
				</td>
				<td>
					${yhcgNumberinfo.zenname}
				</td>
				<td>
					${yhcgNumberinfo.duname}
				</td>
				<td>
				${fns:getDictLabel(yhcgNumberinfo.status, 'status', '')}
				</td>
				
				<!-- 判断页面权限。管理员可以全部延期，督查单位可以延期他督查的，自己可以申请延期自己的 -->
					<%-- <c:if test="${yhcgNumberinfo.status==1 }">
					<c:if test="${(us.isAdmin()==true)||(us.getOffice().getId()==yhcgNumberinfo.responsibilityunit)||(us.getOffice().getParentId()==yhcgNumberinfo.supervisionunit)}">
					<a href="${ctx}/numberinfo/yhcgNumberinfo/formdatayan?id=${yhcgNumberinfo.id}">延期</a>
				<a onclick="yanqi('${yhcgNumberinfo.id}')"  style="cursor:pointer;">延期</a>
					</c:if>
					</c:if>
					<c:if test="${yhcgNumberinfo.status==0}">
					<c:if test="${(us.getOffice().getId()==yhcgNumberinfo.responsibilityunit)}">
					<a href="${ctx}/numberinfo/yhcgNumberinfo/formdatachu?id=${yhcgNumberinfo.id}" onclick="return confirmx('确认要处理该工单吗？', this.href)">处理</a>
					</c:if>
					</c:if>
					<c:if test="${yhcgNumberinfo.status==1}">
					<c:if test="${(us.getOffice().getId()==yhcgNumberinfo.responsibilityunit)}">
					<a href="${ctx}/numberinfo/yhcgNumberinfo/formdatachu?id=${yhcgNumberinfo.id}">完成</a>
					</c:if>
					</c:if>
					<c:if test="${yhcgNumberinfo.status==2}">
					<c:if test="${(us.getOffice().getParentId()==yhcgNumberinfo.supervisionunit)}">
					<a href="${ctx}/numberinfo/yhcgNumberinfo/formdatafu?id=${yhcgNumberinfo.id}">复核</a>
					</c:if>
					</c:if>
					<c:if test="${yhcgNumberinfo.status==3}">
					<c:if test="${us.isAdmin()==true}">
					<a href="${ctx}/numberinfo/yhcgNumberinfo/formdatajie?id=${yhcgNumberinfo.id}">结案</a>
					</c:if>
					</c:if> --%>
				<%-- </td>
				<td>
				<a href="${ctx}/numberinfo/yhcgNumberinfo/delete?id=${yhcgNumberinfo.id}" onclick="return confirmx('确认要删除该延期吗？', this.href)">删除</a>
				</td> --%>
				<td>
			<a href="${ctx}/numberinfo/yhcgNumberinfo/formchakan?id=${yhcgNumberinfo.id}">查看</a></td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
	<!-- </div>
	</td>
	<tr ><td colspan="2" style="height: 200px;width: 100%;">
	<div style="width: 99%;height: 99%">
	<div style="width: 60%;height: 99%;float:left; ">
	
	</div>
	<div style="width: 40%;height: 99%;float:right; ">
	
	</div>
	</div>
	</td></tr>
	</table> -->
	<div class="modal fade" id="demoModal" class="hide" style="top:200px;width: 300px">
        <div class="modal-dialog" >
             <div class="modal-content">
                 <div class="modal-header">
                      <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                      <h4 class="modal-title" id="demoModalLabel">延期申请</h4>
                 </div>
                 <div class="modal-body" style="height: 150px;">
                 <form id="formdatayan" action="${ctx}/numberinfo/yhcgNumberinfo/formdatayan" method="post" >
                 	<input type="hidden" id="id" name="id">
			        <input type="text" name="time" id="time" placeholder="请输入延期天数，此天数为工作日">
			        <textarea  id="yuan" name="yuan" placeholder="请输入延期原因"></textarea>
                     <button type="button" class="btn btn-default" data-dismiss="modal" onclick="shangchuan()" >延期</button>
                     </form>
                     </div>
             </div>
         </div>
    </div>
  <!--   <script type="text/javascript">
    var map = new BMap.Map("allmap");    // 创建Map实例
	map.centerAndZoom(new BMap.Point(117.315225,31.866826), 14);  // 初始化地图,设置中心点坐标和地图级别
	//添加地图类型控件
	map.addControl(new BMap.MapTypeControl({
		mapTypes:[
            BMAP_NORMAL_MAP,
            BMAP_HYBRID_MAP
        ]}));	  
	map.setCurrentCity("合肥市瑶海区");          // 设置地图显示的城市 此项是必须设置的
	map.enableScrollWheelZoom(true);     //开启鼠标滚轮缩放
</script> -->
<div id="importBox" class="hide">
		<form id="importForm" action="${ctx}/numberinfo/yhcgNumberinfo/import" method="post" enctype="multipart/form-data"
			class="form-search" style="padding-left:20px;text-align:center;" onsubmit="loading('正在导入，请稍等...');"><br/>
			<input id="uploadFile" name="file" type="file" style="width:330px"/><br/><br/>　　
			<input id="btnImportSubmit" class="btn btn-primary" type="submit" value="   导    入   "  />
		</form>
	</div>
</body>

</html>